﻿@model ElingOA6_Admin_DSJCJ.Model.PerformanceFileCls
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title></title>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)

    <script type="text/javascript">
        function OK() {
            lpModal.Show();
            var codeNo = FPerformanceFileClsCd.GetText();
            var codeName = FPerformanceFileClsName.GetText();

            if (pd(codeNo, codeName)) {
                codeNo = ASPxClientUtils.Trim(codeNo);
                codeName = ASPxClientUtils.Trim(codeName);
                    $.ajax({
                        type: 'POST',
                        url: rootPath + '/Admin/PerformanceFileCls/CodeSave',
                        data: { codeNo: codeNo, codeName: codeName,isAdd: '@ViewData["blcodeNo"]' },
                        success: function (result) {
                            lpModal.Hide();
                            if (result == "exists") {
                                FPerformanceFileClsCd.SetErrorText("编码已存在");
                                FPerformanceFileClsCd.SetIsValid(false);
                            } else if (result == "ok") {
                                parent.codeOK();
                            } else if (result == "error") {
                                alert("保存失败");
                            }
                        }
                    });
            } else {
                lpModal.Hide();
            }

        }


        function pd(codeNo, codeName) {
            var bl = true;
            if (null == codeNo || ASPxClientUtils.Trim(codeNo) == "") {
                tbCodeNo.SetErrorText("请填写编码");
                tbCodeNo.SetIsValid(false);
                bl = false;
            }
            if (null == codeName || ASPxClientUtils.Trim(codeName) == "") {
                tbCodeName.SetErrorText("请填写名称");
                tbCodeName.SetIsValid(false);
                bl = false;
            }

            return bl;
        }

    </script>

</head>
<body>
    <table class="tableFrom" >
        <tr>
            <th>
                绩效评估文件类别编码:</th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FPerformanceFileClsCd";
                   settings.Width = 100;
                   settings.Text = Model.FPerformanceFileClsCd;
                   settings.Enabled = (bool)@ViewData["blcodeNo"];
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
                @Html.Hidden("hidCodeClsNo", Model.FPerformanceFileClsCd)
            </td>
        </tr>
        <tr>
            <th>
                绩效评估文件类别名称:</th>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FPerformanceFileClsName";
                   settings.Width = 100;
                   settings.Text = Model.FPerformanceFileClsName;
                   settings.Properties.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.ImageWithText;
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
            </td>
        </tr>

    </table>

    <script>
        lp.Hide();
    </script>

</body>
</html>
